#ifndef MATRIX_H
#define MATRIX_H

// 3x3 fixed-point matrix.

typedef struct matrix {
	fixed_t m11, m12, m13;
	fixed_t m21, m22, m23;
	fixed_t m31, m32, m33;
} matrix_t;

void matrix_mul(const matrix_t *A, const matrix_t *B, matrix_t *out);
void matrix_add(const matrix_t *A, const matrix_t *B, matrix_t *out);
void matrix_sub(const matrix_t *A, const matrix_t *B, matrix_t *out);
fixed_t matrix_det(const matrix_t *A);
void matrix_inverse(const matrix_t *A, matrix_t *out);
void matrix_transpose(const matrix_t *A, matrix_t *out);

extern const matrix_t MATRIX_IDENTITY;

#endif
